import axios from "axios";
import { Toast } from 'vant';
export function request(config) {
  const instance = axios.create({
    baseURL: "http://xjt51921.top:2000",
    timeout: 5000,
  });
  instance.interceptors.response.use(
    (res) => {

      Toast.loading({
        message: "加载中...",
        forbidClick: true
      });
      return res.data;
    },
    (err) => {
      return "你妈了个巴子请求失败！";
    }
  );
  // 返回axios实例，也支持promise
  return instance(config);
}


